use glib_ffi;
use std::collections::HashSet;
use std::ptr;
+use std::path::Path;
use ObjectName;
unsafe extern "C" fn read_variant_table(_key: glib_ffi::gpointer, value: glib_ffi::gpointer, hash_set: glib_ffi::gpointer) {
pub trait RepoExtManual {
- fn new_for_str(path: &str) -> Repo;
+ fn new_for_path<P: AsRef<Path>>(path: P) -> Repo;
fn traverse_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(
&self,
commit_checksum: &str,
}
impl<O: IsA<Repo> + IsA<glib::Object> + Clone + 'static> RepoExtManual for O {
- fn new_for_str(path: &str) -> Repo {
- Repo::new(&gio::File::new_for_path(path))
+ fn new_for_path<P: AsRef<Path>>(path: P) -> Repo {
+ Repo::new(&gio::File::new_for_path(path.as_ref()))
}
fn traverse_commit<'a, P: Into<Option<&'a gio::Cancellable>>>(
use libostree::prelude::*;
fn main() {
- let repo = libostree::Repo::new_for_str("../../../repo-bare");
+ let repo = libostree::Repo::new_for_path("../../../repo-bare");
//let result = repo.create(libostree::RepoMode::Archive, Option::None);
//result.expect("we did not expect this to fail :O");